<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/facilities/facilitiesInfo/save}">
        <input type="hidden" name="id" th:if="${facilitiesInfo}" th:value="${facilitiesInfo.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">设备名称</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" placeholder="请输入设备名称" th:value="${facilitiesInfo?.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设备所在网格</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="grid_id" placeholder="请输入设备所在网格" th:value="${facilitiesInfo?.grid_id}">
                <!--TODO 添加下拉框-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设施创建时间</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" id="facilitiesTime" name="facilitiesTime" placeholder="请输入设施创建时间" th:value="${facilitiesInfo?.facilitiesTime}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设施负责人名字</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="facilitieHeadName" placeholder="请输入设施负责人名字" th:value="${facilitiesInfo?.facilitieHeadName}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设施负责人电话</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="facilitieHeadPhone" placeholder="请输入设施负责人电话" th:value="${facilitiesInfo?.facilitieHeadPhone}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设施开放时间</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" id="facilitieOpenTime" name="facilitieOpenTime" placeholder="请输入设施开放时间" th:value="${facilitiesInfo?.facilitieOpenTime + '-' + facilitiesInfo?.facilitieEndTime}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设施分类</label>
            <div class="layui-input-inline">
                <!--TODO 添加radio-->
                <input type="radio" name="facilitieType" lay-filter="levelM" value="1" title="体育器材" th:checked="${facilitiesInfo?.facilitieType} == 1">
                <input type="radio" name="facilitieType" lay-filter="levelM" value="1" title="幼儿设备" th:checked="${facilitiesInfo?.facilitieType} == 2">
                <input type="radio" name="facilitieType" lay-filter="levelM" value="1" title="电器设备" th:checked="${facilitiesInfo?.facilitieType} == 3">
                <input type="radio" name="facilitieType" lay-filter="levelM" value="1" title="建设器材" th:checked="${facilitiesInfo?.facilitieType} == 4">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${facilitiesInfo?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>

<script th:replace="/common/template :: script">
</script>
    <script type="text/javascript">
        layui.use(['element', 'form','laydate'], function () {
            var laydate = layui.laydate;
            //设施开放开始时间
            laydate.render({
                elem: '#facilitieOpenTime'
                , type: 'time'
                , range: true
                , format: 'HH:mm:ss'
            });

            laydate.render({
                elem: '#facilitiesTime'
                , type: 'date'
                , range: false
                , format: 'yyyy-MM-dd HH:mm:ss'
            });

        });
    </script>
</body>
</html>